<?php

function spiel_anlegen ($liga,$homeT,$guestT,$matchday,$stageId,$comment,$free)
{
	// $cHquery="SELECT id FROM combinations WHERE teamId=",$homeU;
	// $cHe = mysql_query($cHquery);
	// $homeC = (mysql_fetch_object($cHe))->id;
	
	// $cGquery="SELECT id FROM combinations WHERE teamId=",$guestU;
	// $cGe = mysql_query($cGquery);
	// $guestC = (mysql_fetch_object($cGe))->id;
	include("inc_configuration.php");
	
	
	$aQuery = "INSERT INTO $tbl_matches (homeT, guestT, stageId, leagueId, matchday, comment, free) 
				VALUES ($homeT, $guestT, $stageId, $liga, $matchday, $comment, $free)";
	$anlegen = mysql_query($aQuery);
	return ($aQuery);
}

function spiel_update ($mId,$liga,$homeT,$guestT,$matchday,$stageId,$comment,$free)
{
	include("inc_configuration.php");
	
	$aQuery = "UPDATE $tbl_matches set homeT=$homeT, guestT=$guestT, stageId=$stageId, leagueId=$liga, matchday=$matchday, comment='$comment', free=$free WHERE id=$mId";
	$anlegen = mysql_query($aQuery);
	return ($aQuery);
}



?>